<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>珠峰架构师成长计划</title>
    <link rel="stylesheet" type="text/css" href="../static/css/main.css">
</head>
<body>
<div class="nav">
    <div class="logo">
        
            珠峰架构师成长计划
        
    </div>
<ul><li><a href="../index.html">0.Async</a></li><li><a href="../html/0.editor.html">0.editor</a></li><li><a href="../html/0.module.html">0.module</a></li><li><a href="../html/1.ES2015.html">1.ES2015</a></li><li><a href="../html/2.Promise.html">2.Promise</a></li><li><a href="../html/3.Node.html">3.Node</a></li><li><a href="../html/4.NodeInstall.html">4.NodeInstall</a></li><li><a href="../html/5.REPL.html">5.REPL</a></li><li><a href="../html/6.NodeCore.html">6.NodeCore</a></li><li><a href="../html/7.module&NPM.html">7.module&NPM</a></li><li><a href="../html/8.Encoding.html">8.Encoding</a></li><li><a href="../html/9.Buffer.html">9.Buffer</a></li><li><a href="../html/10.fs.html">10.fs</a></li><li><a href="../html/11.Stream-1.html">11.Stream-1</a></li><li><a href="../html/11.Stream-2.html">11.Stream-2</a></li><li><a href="../html/11.Stream-3.html">11.Stream-3</a></li><li><a href="../html/11.Stream-4.html">11.Stream-4</a></li><li><a href="../html/12-Network-2.html">12-Network-2</a></li><li><a href="../html/12.NetWork-3.html">12.NetWork-3</a></li><li><a href="../html/12.Network-1.html">12.Network-1</a></li><li><a href="../html/13.tcp.html">13.tcp</a></li><li><a href="../html/14.http-1.html">14.http-1</a></li><li><a href="../html/14.http-2.html">14.http-2</a></li><li><a href="../html/15.compress.html">15.compress</a></li><li><a href="../html/16.crypto.html">16.crypto</a></li><li><a href="../html/17.process.html">17.process</a></li><li><a href="../html/18.yargs.html">18.yargs</a></li><li><a href="../html/19.cache.html">19.cache</a></li><li><a href="../html/20.action.html">20.action</a></li><li><a href="../html/21.https.html">21.https</a></li><li><a href="../html/22.cookie.html">22.cookie</a></li><li><a href="../html/23.session.html">23.session</a></li><li><a href="../html/24.express-1.html">24.express-1</a></li><li><a href="../html/24.express-2.html">24.express-2</a></li><li><a href="../html/24.express-3.html">24.express-3</a></li><li><a href="../html/24.express-4.html">24.express-4</a></li><li><a href="../html/25.koa-1.html">25.koa-1</a></li><li><a href="../html/26.webpack-1-basic.html">26.webpack-1-basic</a></li><li><a href="../html/26.webpack-2-optimize.html">26.webpack-2-optimize</a></li><li><a href="../html/26.webpack-3.tapable.html">26.webpack-3.tapable</a></li><li><a href="../html/26.webpack-4-AST.html">26.webpack-4-AST</a></li><li><a href="../html/26.webpack-5-source.html">26.webpack-5-source</a></li><li><a href="../html/26.webpack-6-loader.html">26.webpack-6-loader</a></li><li><a href="../html/26.webpack-7-plugin.html">26.webpack-7-plugin</a></li><li><a href="../html/26.webpack-8-hand.html">26.webpack-8-hand</a></li><li><a href="../html/27.react-1.html">27.react-1</a></li><li><a href="../html/27.react-2.html">27.react-2</a></li><li><a href="../html/27.react-3.html">27.react-3</a></li><li><a href="../html/27.react-4-immutable.html">27.react-4-immutable</a></li><li><a href="../html/27.react-5-react-dom-diff.html">27.react-5-react-dom-diff</a></li><li><a href="../html/27.react-6.html">27.react-6</a></li><li><a href="../html/28.react-mobx.html">28.react-mobx</a></li><li><a href="../html/28.redux-0.html">28.redux-0</a></li><li><a href="../html/28.redux-1.html">28.redux-1</a></li><li><a href="../html/28.redux-2-中间件.html">28.redux-2-中间件</a></li><li><a href="../html/28.redux-3-saga.html">28.redux-3-saga</a></li><li><a href="../html/28.redux-jwt-back.html">28.redux-jwt-back</a></li><li><a href="../html/28.redux-jwt-front.html">28.redux-jwt-front</a></li><li><a href="../html/29.mongodb-1.html">29.mongodb-1</a></li><li><a href="../html/29.mongodb-2.html">29.mongodb-2</a></li><li><a href="../html/29.mongodb-3.html">29.mongodb-3</a></li><li><a href="../html/29.mongodb-4.html">29.mongodb-4</a></li><li><a href="../html/29.mongodb-5.html">29.mongodb-5</a></li><li><a href="../html/29.mongodb-6.html">29.mongodb-6</a></li><li><a href="../html/30.cms-1-mysql.html">30.cms-1-mysql</a></li><li><a href="../html/30.cms-2-mysql.html">30.cms-2-mysql</a></li><li><a href="../html/30.cms-3-mysql.html">30.cms-3-mysql</a></li><li><a href="../html/30.cms-4-egg.html">30.cms-4-egg</a></li><li><a href="../html/30.cms-5-api.html">30.cms-5-api</a></li><li><a href="../html/30.cms-6-roadhog.html">30.cms-6-roadhog</a></li><li><a href="../html/30.cms-7-umi.html">30.cms-7-umi</a></li><li><a href="../html/30.cms-8-dva.html">30.cms-8-dva</a></li><li><a href="../html/30.cms-9-dva.html">30.cms-9-dva</a></li><li><a href="../html/30.cms-10-front.html">30.cms-10-front</a></li><li class="active"><a href="../html/30.cms-11-deploy.html">30.cms-11-deploy</a></li><li><a href="../html/33.redis.html">33.redis</a></li><li><a href="../html/34.unittest.html">34.unittest</a></li><li><a href="../html/35.jwt.html">35.jwt</a></li><li><a href="../html/36.websocket-1.html">36.websocket-1</a></li><li><a href="../html/36.websocket-2.html">36.websocket-2</a></li><li><a href="../html/38.chat-api-1.html">38.chat-api-1</a></li><li><a href="../html/38.chat-api-2.html">38.chat-api-2</a></li><li><a href="../html/38.chat-3.html">38.chat-3</a></li><li><a href="../html/38.chat-api-3.html">38.chat-api-3</a></li><li><a href="../html/38.chat.html">38.chat</a></li><li><a href="../html/38.chat2.html">38.chat2</a></li><li><a href="../html/38.chat2.html">38.chat2</a></li><li><a href="../html/39.crawl-0.html">39.crawl-0</a></li><li><a href="../html/39.crawl-1.html">39.crawl-1</a></li><li><a href="../html/39.crawl-2.html">39.crawl-2</a></li><li><a href="../html/40.deploy.html">40.deploy</a></li><li><a href="../html/41.safe.html">41.safe</a></li><li><a href="../html/42.test.html">42.test</a></li><li><a href="../html/43.nginx.html">43.nginx</a></li><li><a href="../html/44.enzyme.html">44.enzyme</a></li><li><a href="../html/45.docker.html">45.docker</a></li><li><a href="../html/46.elastic.html">46.elastic</a></li><li><a href="../html/47.oauth.html">47.oauth</a></li><li><a href="../html/48.wxpay.html">48.wxpay</a></li><li><a href="../html/49.nunjucks.html">49.nunjucks</a></li><li><a href="../html/50.ketang.html">50.ketang</a></li><li><a href="../html/index.html">index</a></li><li><a href="../html/51.typescript.html">51.typescript</a></li><li><a href="../html/52.UML.html">52.UML</a></li><li><a href="../html/53.design.html">53.design</a></li><li><a href="../html/index.html">index</a></li><li><a href="../html/54.linux.html">54.linux</a></li><li><a href="../html/55.yaml.html">55.yaml</a></li><li><a href="../html/50.ketang2.html">50.ketang2</a></li><li><a href="../html/56.ts.html">56.ts</a></li><li><a href="../html/57.ts_react.html">57.ts_react</a></li><li><a href="../html/58.react-ssr.html">58.react-ssr</a></li><li><a href="../html/59.react-ssr.html">59.react-ssr</a></li></ul></div>


<div class="warpper">

    <div class="page-toc">
        <ul><li><a href="#t01. 服务器部署步骤">1. 服务器部署步骤</a><ul><li><a href="#t11.2 购买域名">1.2 购买域名</a></li><li><a href="#t21.3 云主机">1.3 云主机</a></li><li><a href="#t31.4 购买阿里云">1.4 购买阿里云</a></li><li><a href="#t41.5 备案">1.5 备案</a></li></ul></li><li><a href="#t52 安装软件">2 安装软件</a><ul><li><a href="#t62.1  连接服务器">2.1  连接服务器</a></li><li><a href="#t72.2 升级系统">2.2 升级系统</a></li><li><a href="#t82.3 安装工具包">2.3 安装工具包</a></li><li><a href="#t92.4 安装node">2.4 安装node</a></li><li><a href="#t102.5 nginx">2.5 nginx</a><ul><li><a href="#t112.5.1 安装">2.5.1 安装</a></li><li><a href="#t122.5.2 nginx命令">2.5.2 nginx命令</a></li></ul></li><li><a href="#t132.6 mysql">2.6 mysql</a></li></ul></li><li><a href="#t143. 部署项目">3. 部署项目</a><ul><li><a href="#t153.1 部署后端项目">3.1 部署后端项目</a></li><li><a href="#t163.2 部署前端项目">3.2 部署前端项目</a></li></ul></li><li><a href="#t17参考">参考</a></li></ul>
    </div>
    
    <div class="content markdown-body">
        <h2 id="t01. &#x670D;&#x52A1;&#x5668;&#x90E8;&#x7F72;&#x6B65;&#x9AA4;">1. &#x670D;&#x52A1;&#x5668;&#x90E8;&#x7F72;&#x6B65;&#x9AA4; <a href="#t01. &#x670D;&#x52A1;&#x5668;&#x90E8;&#x7F72;&#x6B65;&#x9AA4;"> # </a></h2>
<ol>
<li>&#x8D2D;&#x4E70;&#x81EA;&#x5DF1;&#x7684;&#x57DF;&#x540D;</li>
<li>&#x57DF;&#x540D;&#x5907;&#x6848;</li>
<li>&#x8D2D;&#x4E70;&#x670D;&#x52A1;&#x5668;</li>
<li>&#x914D;&#x7F6E;&#x670D;&#x52A1;&#x5668;&#x5E94;&#x7528;&#x73AF;&#x5883;</li>
<li>&#x5B89;&#x88C5;&#x914D;&#x7F6E;&#x670D;&#x52A1;&#x5668;</li>
<li>&#x9879;&#x76EE;&#x8FDC;&#x7A0B;&#x90E8;&#x7F72;&#x548C;&#x53D1;&#x5E03;&#x4E0E;&#x66F4;&#x65B0;</li>
</ol>
<h3 id="t11.2 &#x8D2D;&#x4E70;&#x57DF;&#x540D;">1.2 &#x8D2D;&#x4E70;&#x57DF;&#x540D; <a href="#t11.2 &#x8D2D;&#x4E70;&#x57DF;&#x540D;"> # </a></h3>
<ul>
<li><a href="https://dnspod.cloud.tencent.com/">&#x817E;&#x8BAF;&#x4E91;</a></li>
<li><a href="https://wanwang.aliyun.com/">&#x963F;&#x91CC;&#x4E91;</a></li>
<li><a href="https://cloud.baidu.com/product/bcd.html">&#x767E;&#x5EA6;&#x4E91;</a></li>
<li><a href="https://www.22.cn/">&#x7231;&#x540D;&#x7F51;</a></li>
<li><a href="https://sg.godaddy.com/">godaddy</a></li>
</ul>
<h3 id="t21.3 &#x4E91;&#x4E3B;&#x673A;">1.3 &#x4E91;&#x4E3B;&#x673A; <a href="#t21.3 &#x4E91;&#x4E3B;&#x673A;"> # </a></h3>
<ul>
<li><a href="https://www.aliyun.com/">&#x963F;&#x91CC;&#x4E91; ECS</a></li>
<li><a href="https://aws.amazon.com/cn/">&#x4E9A;&#x9A6C;&#x900A; AWS</a></li>
<li><a href="https://cloud.baidu.com/">&#x767E;&#x5EA6;&#x4E91;</a></li>
</ul>
<h3 id="t31.4 &#x8D2D;&#x4E70;&#x963F;&#x91CC;&#x4E91;">1.4 &#x8D2D;&#x4E70;&#x963F;&#x91CC;&#x4E91; <a href="#t31.4 &#x8D2D;&#x4E70;&#x963F;&#x91CC;&#x4E91;"> # </a></h3>
<ul>
<li><a href="https://ecs-buy.aliyun.com/wizard/#/postpay/cn-beijing">&#x9009;&#x62E9;&#x914D;&#x7F6E;</a></li>
<li>&#x955C;&#x50CF; Ubuntu 16.04 64&#x4F4D;</li>
</ul>
<h3 id="t41.5 &#x5907;&#x6848;">1.5 &#x5907;&#x6848; <a href="#t41.5 &#x5907;&#x6848;"> # </a></h3>
<ul>
<li><a href="https://beian.aliyun.com">&#x963F;&#x91CC;&#x4E91;&#x5907;&#x6848;</a></li>
<li><a href="https://bsn.console.aliyun.com/#/bsnManagement">&#x5907;&#x6848;&#x670D;&#x52A1;&#x53F7;&#x7BA1;&#x7406;</a></li>
</ul>
<h2 id="t52 &#x5B89;&#x88C5;&#x8F6F;&#x4EF6;">2 &#x5B89;&#x88C5;&#x8F6F;&#x4EF6; <a href="#t52 &#x5B89;&#x88C5;&#x8F6F;&#x4EF6;"> # </a></h2>
<h3 id="t62.1  &#x8FDE;&#x63A5;&#x670D;&#x52A1;&#x5668;">2.1  &#x8FDE;&#x63A5;&#x670D;&#x52A1;&#x5668; <a href="#t62.1  &#x8FDE;&#x63A5;&#x670D;&#x52A1;&#x5668;"> # </a></h3>
<pre><code class="lang-js">ssh <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="e4968b8b90a4">[email&#160;protected]</a><span class="hljs-number">47.92</span><span class="hljs-number">.243</span><span class="hljs-number">.226</span>
</code></pre>
<h3 id="t72.2 &#x5347;&#x7EA7;&#x7CFB;&#x7EDF;">2.2 &#x5347;&#x7EA7;&#x7CFB;&#x7EDF; <a href="#t72.2 &#x5347;&#x7EA7;&#x7CFB;&#x7EDF;"> # </a></h3>
<pre><code class="lang-js">apt-get update
apt-get upgrade
</code></pre>
<h3 id="t82.3 &#x5B89;&#x88C5;&#x5DE5;&#x5177;&#x5305;">2.3 &#x5B89;&#x88C5;&#x5DE5;&#x5177;&#x5305; <a href="#t82.3 &#x5B89;&#x88C5;&#x5DE5;&#x5177;&#x5305;"> # </a></h3>
<pre><code class="lang-js">apt-get install wget curl git
</code></pre>
<h3 id="t92.4 &#x5B89;&#x88C5;node">2.4 &#x5B89;&#x88C5;node <a href="#t92.4 &#x5B89;&#x88C5;node"> # </a></h3>
<ul>
<li><a href="https://github.com/creationix/nvm/blob/master/README.md">nvm</a><pre><code class="lang-js">wget -qO- https:<span class="hljs-comment">//raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash</span>
source  /root/.bashrc
nvm install stable
node -v
npm i cnpm -g
npm i nrm -g
</code></pre>
</li>
</ul>
<h3 id="t102.5 nginx">2.5 nginx <a href="#t102.5 nginx"> # </a></h3>
<p>Nginx&#x662F;&#x4E00;&#x4E2A;&#x9AD8;&#x6027;&#x80FD;&#x7684;HTTP&#x548C;&#x53CD;&#x5411;&#x4EE3;&#x7406;&#x670D;&#x52A1;&#x5668;</p>
<h4 id="t112.5.1 &#x5B89;&#x88C5;">2.5.1 &#x5B89;&#x88C5; <a href="#t112.5.1 &#x5B89;&#x88C5;"> # </a></h4>
<pre><code class="lang-js">apt-get install nginx
</code></pre>
<h4 id="t122.5.2 nginx&#x547D;&#x4EE4;">2.5.2 nginx&#x547D;&#x4EE4; <a href="#t122.5.2 nginx&#x547D;&#x4EE4;"> # </a></h4>
<table>
<thead>
<tr>
<th style="text-align:left">&#x540D;&#x79F0;</th>
<th style="text-align:left">&#x547D;&#x4EE4;</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">&#x542F;&#x52A8;nginx</td>
<td style="text-align:left">nginx -c /etc/nginx/nginx.conf</td>
</tr>
<tr>
<td style="text-align:left">&#x5173;&#x95ED; nginx</td>
<td style="text-align:left">nginx -s stop</td>
</tr>
<tr>
<td style="text-align:left">&#x91CD;&#x8BFB;&#x914D;&#x7F6E;&#x6587;&#x4EF6;</td>
<td style="text-align:left">nginx -s reload kill -HUP nginx</td>
</tr>
<tr>
<td style="text-align:left">&#x5E38;&#x7528;&#x547D;&#x4EE4;</td>
<td style="text-align:left">service nginx {start</td>
<td>stop</td>
<td>status</td>
<td>restart</td>
<td>reload</td>
<td>configtest</td>
<td>}</td>
</tr>
</tbody>
</table>
<h3 id="t132.6 mysql">2.6 mysql <a href="#t132.6 mysql"> # </a></h3>
<p>&#x5B89;&#x88C5;mysql</p>
<pre><code class="lang-js">apt install mysql-server -y
apt install mysql-client
apt install libmysqlclient-dev
</code></pre>
<ul>
<li><a href="https://www.cnblogs.com/roadofstudy/p/7446690.html">root&#x7528;&#x6237;&#x91CD;&#x7F6E;&#x5BC6;&#x7801;&#x95EE;&#x9898;</a></li>
</ul>
<h2 id="t143. &#x90E8;&#x7F72;&#x9879;&#x76EE;">3. &#x90E8;&#x7F72;&#x9879;&#x76EE; <a href="#t143. &#x90E8;&#x7F72;&#x9879;&#x76EE;"> # </a></h2>
<h3 id="t153.1 &#x90E8;&#x7F72;&#x540E;&#x7AEF;&#x9879;&#x76EE;">3.1 &#x90E8;&#x7F72;&#x540E;&#x7AEF;&#x9879;&#x76EE; <a href="#t153.1 &#x90E8;&#x7F72;&#x540E;&#x7AEF;&#x9879;&#x76EE;"> # </a></h3>
<pre><code class="lang-js">git clone https:<span class="hljs-comment">//gitee.com/zhufengpeixun/2018projects1.git</span>
cd <span class="hljs-number">2018</span>projects1/zhufeng-cms
yarn

wget http:<span class="hljs-comment">//7xil5b.com1.z0.glb.clouddn.com/zhufeng-cms.sql</span>
mysql -uroot -proot
CREATE DATABASE IF NOT EXISTS zhufengcms <span class="hljs-keyword">default</span> charset utf8 COLLATE utf8_general_ci; 
use zhufengcms;
source zhufengcms.sql;
yarn start
</code></pre>
<h3 id="t163.2 &#x90E8;&#x7F72;&#x524D;&#x7AEF;&#x9879;&#x76EE;">3.2 &#x90E8;&#x7F72;&#x524D;&#x7AEF;&#x9879;&#x76EE; <a href="#t163.2 &#x90E8;&#x7F72;&#x524D;&#x7AEF;&#x9879;&#x76EE;"> # </a></h3>
<pre><code class="lang-sql">cd 2018projects1/zhufeng-cms-front
yarn 
yarn build

</code></pre>
<p>/etc/nginx/nginx.conf</p>
<pre><code class="lang-js">include /etc/nginx/conf.d<span class="hljs-comment">/*.conf;
include /etc/nginx/sites-enabled/*;
</span></code></pre>
<p>include /etc/nginx/sites-enabled/default</p>
<pre><code class="lang-js">root /<span class="hljs-keyword">var</span>/www/html;
</code></pre>
<pre><code>scp 1.txt <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="1c6e7373685c282b32252e322e282f322e2e2a">[email&#160;protected]</a>:/root

server {
    listen 80;
    server_name 47.92.243.226;

    root /var/www/html;

    location / {
        try_files $uri $uri/ @router;
        index index.html;
    }

        location /api {
                rewrite ^/api/(.*)$ /$1 break;
                proxy_pass http://127.0.0.1:7001;
        }

        location @router {
               rewrite ^.*$ /index.html break;
        }


}
</code></pre><h2 id="t17&#x53C2;&#x8003;">&#x53C2;&#x8003; <a href="#t17&#x53C2;&#x8003;"> # </a></h2>
<ul>
<li><a href="https://yarn.bootcss.com/docs/usage/">yarn</a></li>
<li><a href="https://eggjs.org/zh-cn/core/deployment.html">deployment</a></li>
<li><a href="https://umijs.org/zh/guide/deploy.html">deploy</a></li>
</ul>

        <div class="copyright">Powered by <a href="https://github.com/jaywcjlove/idoc" target="_blank">idoc</a>. Dependence <a href="https://nodejs.org">Node.js</a> run.</div>
    </div>
    
</div>

<script data-cfasync="false" src="/cdn-cgi/scripts/5c5dd728/cloudflare-static/email-decode.min.js"></script><script src="https://cdn.bootcss.com/jquery/3.0.0/jquery.js"></script>
<script>
$('.warpper .page-toc ul ul li a').on('click',function(){
  $('.warpper .page-toc ul ul li a').removeClass('my-active')
  $(this).addClass('my-active')
})
  // if (!$('.understand-me').length) {
  //   var bar = $(window).height() - $('.navbar ').height() - $('.page-toc').position().top;
  //   var count = bar / 26 / 2;
  //   var barHeight = $('.page-toc').outerHeight();
  //   $('.page-toc li').eq(0).children('a').addClass('red');
  //   var arr = [];
  //   $("h1,h2,h3,h4,h5,h6").each(function () {
  //     arr.push($(this).position().top);
  //   });
  //   var timer
  //   function dark() {
  //     clearTimeout(timer)
  //      timer = setTimeout(function () {
  //      var top = Math.abs($('.page-toc > ul').position().top);
  //      var cur = $('.content').scrollTop();
  //      for (var i = arr.length; i >= 0; i--) {
  //        if (arr[i] <= cur) {
  //          break;
  //        }
  //      }
  //      if (i === -1) {
  //        i = 0;
  //      }
  //      $('.page-toc li a').removeClass('red');
  //      $('.page-toc li').eq(i).children('a').addClass('red');
  //      let height = $('.page-toc li').eq(i).position().top-$('.page-toc').height(); // 如果当前的offset出去了 回到中间可好？
  //      $('.page-toc').scrollTop(height+$('.page-toc').height()/2);
  //    },200)
  //   }

  //   $('.content').on('scroll', dark);
  // }
</script>
<style>

    /* ::-webkit-scrollbar{width:14px;}
    ::-webkit-scrollbar-track{background-color:transparent;}
    ::-webkit-scrollbar-thumb{background-color:transparent;}
    ::-webkit-scrollbar-thumb:hover {background-color:transparent}
    ::-webkit-scrollbar-thumb:active {background-color:transparent} */

    .page-toc > ul .red {
        background: #f3f3f3;
        z-index: 1;
        border-left: 3px solid #009a61;
        -webkit-transition: all .2s ease;
        transition: all .2s ease;
        color: #000
    }





</style>
</body>
</html>
